package bean;

import status.OrderStatus;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 订单
 */
public class Order {

    private String orderCode;                                               //订单编码
    private Date createTime;                                                //订单创建时间
    private BigDecimal price;                                               //订单总价
    private String status = OrderStatus.ORDER_STATUS_NOT_SHIPPED;           //订单状态
    private int userId;                                                     //订单所属的用户的id
    private List<OrderItem> items;

    public Order() {
    }

    public Order(String orderCode, Date createTime, BigDecimal price, String status, int userId, List<OrderItem> items) {
        this.orderCode = orderCode;
        this.createTime = createTime;
        this.price = price;
        this.status = status;
        this.userId = userId;
        this.items = items;
    }

    public List<OrderItem> getItems() {
        return items;
    }

    public void setItems(List<OrderItem> items) {
        this.items = items;
    }

    public String getOrderCode() {
        return orderCode;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    @Override
    public String toString() {
        return "Order{" +
                "orderCode='" + orderCode + '\'' +
                ", createTime=" + createTime +
                ", price=" + price +
                ", status='" + status + '\'' +
                ", userId=" + userId +
                ", items=" + items +
                '}';
    }
}
